ci: Add a context for testing flatpak
authorColin Walters <walters@verbum.org>
Fri, 28 Apr 2017 13:32:35 +0000 (09:32 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 28 Apr 2017 19:56:48 +0000 (19:56 +0000)
This was part of the philosophy behind https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests -
libraries like libostree don't need to replicate everything in unit tests, we
can use the tests from our dependencies directly too.

We'll also get API break coverage testing too.

Closes: #818
Approved by: jlebon

.redhat-ci.yml
ci/flatpak.sh [new file with mode: 0755]

index e560404076fa69b42be4c813d362f8a0e821949b..8b58f80cdf0580f8670b6fbea93806668226da2b 100644 (file)
@@ -135,3 +135,26 @@ tests:
 
 artifacts:
   - test-suite.log
+
+---
+
+inherit: false
+branches:
+    - master
+    - auto
+    - try
+
+context: f25-flatpak
+required: false
+
+# This test case wants an "unprivileged container with bubblewrap",
+# which we don't have right now; so just provision a VM and do a
+# docker --privileged run.
+host:
+  distro: fedora/25/atomic
+
+tests:
+  - docker run --rm --privileged -v $(pwd):/srv/code registry.fedoraproject.org/fedora:25 /bin/sh -c "cd /srv/code && ./ci/flatpak.sh"
+
+artifacts:
+  - test-suite.log
diff --git a/ci/flatpak.sh b/ci/flatpak.sh
new file mode 100755 (executable)
index 0000000..f7edba3
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Build and run flatpak's unit tests using the just-built ostree for this PR.
+
+set -xeuo pipefail
+
+build() {
+    env NOCONFIGURE=1 ./autogen.sh
+    ./configure --prefix=/usr --libdir=/usr/lib64 "$@"
+    make -j 8
+}
+
+codedir=$(pwd)
+
+# Core prep
+dnf -y install dnf-plugins-core
+dnf install -y @buildsys-build
+dnf install -y 'dnf-command(builddep)'
+
+# build+install ostree
+dnf builddep -y ostree
+build
+make install
+tmpd=$(mktemp -d)
+cd ${tmpd}
+# Frozen to a tag for now on general principle
+git clone --recursive --depth=1 -b 0.9.3 https://github.com/flatpak/flatpak
+cd flatpak
+dnf builddep -y flatpak
+# And runtime deps
+dnf install -y flatpak && rpm -e flatpak
+dnf install which attr fuse parallel # for the test suite
+build
+# We want to capture automake results from flatpak
+cleanup() {
+    mv test-suite.log ${codedir} || true
+}
+trap cleanup EXIT
+make -j 8 check